<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <title>出院办理</title>
    <div th:insert="user/common::head"></div>
</head>

<body class="">
    <div class="wrapper ">
        <div th:insert="~{user/common::sidebar(active='patient_checkout.html')}"></div>
        <div class="main-panel">
            <!-- Navbar导航栏 -->
            <nav th:replace="~{user/common::navbar}"></nav>
            <!--搜索栏-->
            <div class="panel-header">
                <form id="search_form" th:action="@{/toPatientCheckout/search}">
                <div class="header text-center">
                    <h2 class="title">出院办理</h2>
                    <div class="input-group no-border col-sm-4 offset-4">
                        <input type="text" name="search" class="form-control" th:placeholder="${msg==null?'姓名或联系方式...':msg}">
                        <span class="input-group-addon">
                            <i class="now-ui-icons ui-1_zoom-bold" onclick="$('#search_form').submit()"></i>
                        </span>
                    </div>
                    <p class="category">搜索患者的记录,支持姓名模糊查询,联系方式精确查询。</p>
                </div>
                </form>
            </div>
            <div class="content">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title">出院办理</h4>
                            </div>
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead class="text-primary">
                                        <th>
                                            患者姓名
                                        </th>
                                        <th>
                                            联系方式
                                        </th>
                                        <th>
                                            所在病房
                                        </th>
                                        <th>
                                            所在床位
                                        </th>
                                        <th>
                                            主治医师
                                        </th>
                                        <th>
                                            住院日期
                                        </th>
                                        <th>
                                            出院日期
                                        </th>
                                        <th>
                                            操作
                                        </th>
                                        </thead>
                                        <tbody>
                                        <tr th:each="patient,status:${patients}">
                                            <td th:text="${patient.getPatientName()}">
                                                患者姓名
                                            </td>
                                            <td th:text="${patient.getPatientPhone()}">
                                                患者联系方式
                                            </td>
                                            <td th:text="${patient.getInpatientwardId()}">
                                                所在病房
                                            </td>
                                            <td th:text="${patient.getBedId()}+'号床'">
                                                所在床位
                                            </td>
                                            <td th:each="doctor,index:${doctors}" th:if="${patient.getDoctorId()==doctor.getDoctorId()}">
                                                [[${doctor.getDoctorName}]]
                                            </td>

                                            <td th:text="${#dates.format(patient.getInDate(),'yyyy-MM-dd')}">
                                                2021-01-29
                                            </td>
                                            <td th:text="${#dates.format(patient.getOutDate(),'yyyy-MM-dd')}">
                                                2021-05-29
                                            </td>

                                            <td>
                                                <a class="btn btn-primary text-white" th:href="@{/toPatientCheckoutInfo/}+${patient.getPatientId()}">办理出院</a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--底部footer-->
            <footer th:replace="~{user/common::footer}"></footer>
        </div>
    </div>
</body>

<!--通用footerJs-->
<script th:replace="~{user/common::footerJs}"></script>

</html>
